{include file="public/header" /}
<style>
    .layui-form-select dl dd.layui-this {
        color: #063988 !important;
    }

    .layui-form-select dl dd {
        text-align: center;
    }

    .layui-form-select .layui-input {
        border: none;
        padding-left: 0 !important;
        text-align: right;
        width: 100%;
    }

    .layui-form-select {
        width: 80%;
    }

    .set-list input {
        text-align: right;
    }
</style>
<body class="hide-top bgc">

<div class="draw-container">
    <img src="/static/index/img/icon18.png" alt="">
    <div class="draw-content">
        <div class="draw-hd">
            <i class="layui-icon layui-icon-left"></i> 账户转账
        </div>
        <form action="{:url('transfer/save')}" method="post" class="form layui-form">
            <div class="transfer-content ">

                <ul class="transfer-list">
                    <li style="display: flex;align-items: center;"><p>转账账户</p>
                        <select name="account">
                            <option value="currency">余额(余额：{$user.assets.currency})</option>
                        </select>
                    </li>
                    <li><p>转账金额</p>
                        <input type="text" lay-verify="required" lay-reqtext="请填写转账金额" lay-verType="tips"
                               name="amount" placeholder="请填写转账金额"
                               onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" autocomplete="off">
                    </li>
                    <li><p>收账会员手机号</p>
                        <input type="text" type="text" lay-verify="required" lay-reqtext="请填写收账会员手机号"
                               lay-verType="tips"
                               name="take" id="take" placeholder="请填写收账会员手机号" autocomplete="off">
                    </li>
                    <li class="take_info" style="display: none"><p>收账会员姓名</p>
                        <input type="text" readonly value="" class="take_nickname">

                    </li>
                    <li><p>支付密码</p>
                        <input type="password" lay-verify="required" lay-reqtext="请输入支付密码" lay-verType="tips"
                               name="pay_password" placeholder="请输入支付密码">
                    </li>
                </ul>
            </div>

            <p class="save upd-save" lay-submit lay-filter="save" formObj=".form">确认转账</p>

            <div class="flex-center">
                <a href="{:url('transfer/record')}" class="transfer-rec">转账记录
                    <img src="/static/index/img/icon20.png" alt="">
                </a>
            </div>
        </form>
    </div>
</div>
</body>
{include file="public/footer"/}
<script>
    $('#take').blur(function () {
        var value = $(this).val();
        if (value) {
            $.ajax({
                type: 'GET',
                url: '{:url("transfer/verify")}',
                data: {code: value},
                dataType: "json",
                success: function (data) {
                    if (data.code === 1) {
                        $(".take_nickname").val(data.data).css('color', '#008200');
                    } else {
                        $(".take_nickname").val(data.data).css('color', 'red');
                    }
                    $(".take_info").show();
                }
            });
        } else {
            $(".take_info").hide();
        }
    });
</script>
</html>